<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('Article_policy/index')}">文章列表</a></li>
        <li><a href="{:url('Article_policy/add')}">添加文章</a></li>
    </ul>

    <form class="well form-inline margin-top-20" method="get">
        <input type="text" class="form-control" name="title" style="width: 200px;" value="{:input('request.title/s','')}" placeholder="请输入文章标题关键字">
        <input class="js-bootstrap-datetime form-control"
               type="text"
               id="input-datetime-start"
               placeholder="选择开始时间"
               name="start"
               value="{:input('request.start/s','')}"
        >
        -
        <input class="js-bootstrap-datetime form-control"
               type="text"
               id="input-datetime-end"
               placeholder="选择结束时间"
               name="end"
               value="{:input('request.end/s','')}"
        >
        <select name="status" class="form-control">
            <option value="">全部</option>
            <option value="1" <eq name=":input('request.status','')" value="1"> selected </eq> >显示</option>
            <option value="0" <eq name=":input('request.status','')" value="0"> selected </eq> >隐藏</option>
        </select>
        <input type="submit" class="btn btn-primary" value="搜索" />
        <a class="btn btn-danger" href="{:url('Article_policy/index')}">清空</a>
    </form>

    <form class="js-ajax-form" action="{:url('Article_policy/listOrder')}" method="post">
        <div class="table-actions">
            <button class="btn btn-primary btn-sm js-ajax-submit" type="submit">{:lang('SORT')}</button>
        </div>
        <table class="table table-hover table-bordered table-list" id="menus-table">
            <thead>
            <tr>
                <th>排序</th>
                <th>ID</th>
                <th>标题</th>
                <th>摘要</th>
                <th>封面图片</th>
                <th>作者</th>
                <th width="60">阅读量</th>
                <th>状态</th>
                <th width="160">创建时间</th>
                <th width="160">修改时间</th>
                <th width="150">操作</th>
            </tr>
            </thead>
            <tbody>
            <foreach name="article" item="v">
                <tr>
                    <td>
                        <input name="list_orders[{$v.id}]" type="text" size="3" value="{$v.list_order}" class="input input-order" style="width: 50px;">
                    </td>
                    <td>{$v.id}</td>
                    <td>{$v.title}</td>
                    <td>{$v.abstract}</td>
                    <td><img src="/upload/{$v.image}" class="js-image-previewer" width="30" /></td>
                    <td>{$v.author}</td>
                    <td>{$v.read_num}</td>
                    <td>
                        <eq name="v.status" value="1">
                            <a href="{:url('Article_policy/changeArticleStatus', ['id' => $v.id])}" data-msg="确定改为隐藏状态吗？" class="label label-success js-ajax-dialog-btn">显示</a>
                            <else/>
                            <a href="{:url('Article_policy/changeArticleStatus', ['id' => $v.id])}" data-msg="确定改为显示状态吗？" class="label label-warning js-ajax-dialog-btn">隐藏</a>
                        </eq>
                    </td>
                    <td>{$v.create_time}</td>
                    <td>{$v.update_time}</td>
                    <td>
                        <a class="btn btn-xs btn-primary" href="{:url('Article_policy/edit', ['id' => $v.id])}">编辑</a>
                        <a class="btn btn-xs btn-danger js-ajax-delete" href="{:url('Article_policy/softDelete', ['id' => $v.id])}">删除</a>
                    </td>
                </tr>
            </foreach>
            </tbody>
        </table>
        <div class="pagination">{$pageButton}</div>
    </form>
</div>
<script src="__STATIC__/js/admin.js?v={$_static_version}"></script>
<script src="__STATIC__/js/js-image-previewer.js"></script>
</body>
</html>